<template>
  <!-- 详情 -->
  <div class="detail">
    <div>
      <input type="button" name="Submit" value="< 返回" onclick="javascript:window.history.back(-1);" />
      <dl>
        <dt>
          <img :src="info.img" alt />
        </dt>
        <dd>
          <h1>{{info.name}}</h1>
          <h2>{{info.area}}</h2>
          <h3>{{info.newtime}}</h3>
          <h2>团购简绍</h2>
          <p>团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍团购简绍</p>
        </dd>
      </dl>

      <van-swipe-cell>
        <div class="d2">
          <p>
            <img
              src="https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00225-2812.jpg"
              alt
            />
          </p>
          <p>
            <span>黄庆涛</span>
            <span>15950932453</span>
          </p>
        </div>

        <template #right>
          <van-button square type="danger" text="删除" @click="Del(item.id)" />
        </template>
      </van-swipe-cell>

      <van-swipe-cell>
        <div class="d2">
          <p>
            <img
              src="https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00225-2812.jpg"
              alt
            />
          </p>
          <p>
            <span>黄康辉</span>
            <span>17324432453</span>
          </p>
        </div>

        <template #right>
          <van-button square type="danger" text="删除" />
        </template>
      </van-swipe-cell>
    </div>
  </div>
</template>


<script>
// import { tableData2 } from "@/api/index";
import axios from "axios";

export default {
  name: "index",

  data() {
    return {
      info: []
    };
  },
  created() {
    this.id = this.$route.params.id;
    //调用函数、
    this.getList();
  },
  methods: {
    //获取详情数据
    getList() {
      axios({
        url: "/api/Detail2",
        method: "post",
        data: {
          id: this.id
        }
      }).then(res => {
        this.info = res.data.data;
      });
    }
  }
};
</script>


<style lang="scss" scoped>
.detail {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: rgb(241, 241, 241);
  input {
    position: absolute;
    margin-top: 2px;
  }
  .d2 {
    display: flex;
    p {
      img {
        width: 50px;
        height: 50px;
        border-radius: 50px;
      }
      span {
        display: block;
        color: #000;
        font-weight: bold;
      }
    }
  }
  dl {
    width: 100%;
    height: 100%;
    dt {
      width: 100%;
      height: 200px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    dd {
      margin-left: 5%;
      width: 90%;
    }
  }
}
</style>